Welcome back in this section of the course.
We're now going to take all the information we've learned in the previous two sections and apply it
in our scripts.
For this project.
We're going to create an SCP from the SCP wiki, if you've ever heard of that.
If not, the SCP wiki is a fun little wiki that tells you about the story of a fictional organization
called the SCP Foundation, and this organization specializes in researching and containing anomalous
objects and entities found on Earth.
These objects can do things like emit strange types of radiation or decay materials around them, cause
mental problems, hallucinations, and so on.
Some scp's can be safe, while other shops could destroy the entire world.
The whole point of an SCP is that it is anomalous.
Now, SCP 294 is described as a drink vending machine that dispenses a drink of whatever you describe
to it.
You can enter in water and get a cup of water, or you could enter in lava and get a cup of lava.
You can also enter in more abstract concepts like pain and it'll dispense to you a cup of paint.
It's a pretty neat SCP that we can replicate in Roblox studio, so I'll demonstrate SCP 294 right here.
We can interact with it and get this guy on our screen, and we can go ahead and enter a drink that
we like.
So if I'd like a cup of water, I can enter in water.
And it'll dispense me a cup of water.
And then I get my nice cup of water and I can drink it.
And there we go.
We have a simple, refreshing cup of water.
And I can also enter in some more abstract concepts, like a cup of pain.
So I could type in pain and dispense that out.
And here I have my cup of pain and if I drink it, I can have some cool effect happen to me.
So let's go ahead and get started creating this in Roblox studio.
All right.
So for us to get started creating this SCP using an object oriented programming, there's a little bit
of setup we need to complete.
Now I've attached this model to the lecture which contains all the assets you'll need for this project.
So you'll want to go ahead and grab it and insert it into your game.
With our model we're going to go ahead and take some of these assets and place them inside of some different
services in our game.
So first off this SCP 294 assets folder is going to be placed in replicated storage, and it houses
some remote functions for us as well as a remote event as well as a module script that is going to act
as a class for all of our drink objects.
And here I also have the tool for our drink as well, and some other module scripts that will contain
some pre-made drinks for our drink machine, as well as some neat effects for particular kinds of drinks.
So let's go ahead and drag this and place it inside of a replicated storage.
And then the next folder here, SCP 294 sounds is going to contain all the sounds we'll need for our
machine, such as clicking buttons, the different dispense sounds, as well as the different drinking
sounds for our cup.
Currently, all of these don't have a sound ID applied to them, and that's because they're going to
have to upload your own sounds in order to replace the sound IDs.
Due to a audio update that Roblox pass where we can't share audio IDs anymore.
So I'm going to also attach a bunch of audio files that you can use and upload to put into each of these
audio files.
You won't have to do it for the button, uh, the heartbeat or the punch sound effect, because I already
found those for free.
But otherwise you're going to have to upload your own sound IDs for the sound instances.
And you also need to note that your Roblox account will have an audio upload limit.
Unless you've, uh, ID verified your account, your upload limit can be increased to 100, but I think
the default is ten.
So again, you want to be a little bit careful with how many audio files you're uploading.
Otherwise we can take this folder and place it inside of our sound service.
So again, I'm going to have all those audio files attached to the lecture.
Make sure you upload them to Roblox and put their IDs to their respective sound instances.
Here the script is going to act as our initializer.
It's just going to run the module scripts and make sure everything gets set up and initialized for our
SCP when the server starts, and we can just place this inside of server script service.
And then we're going to have A294 guy.
This is going to be for the client.
And again it's going to contain that guy for our SCP.
And it's also going to contain the functionality for like drinking the drinks from the machine, displaying
that text on the bottom of the screen and that kind of fun stuff.
And we're going to go ahead and place this inside of our starter GUI service.
Last things we have in here is going to be the SCP itself.
This is just the model.
And inside of this model just has an attachment and a proximity prompt.
And the way we're going to set this up allows us to duplicate as many of these SCP objects as we like,
so we can have multiple of these drink machines in our game.
And in order for our game to collect each of the drink machines and connect a function to the proximity
prompt, we're going to make sure that this SCP object or this part here, this mesh part has a tag
attached to it.
Now you should be familiar with the collection service, but if you aren't, then what the collection
service does is that we can attach tags to different things in our game, different instances, and
then using the collection service, we can get all the instances in our game that have a particular
tag.
So I also have a plug in attached to the lecture for creating new tags.
And when you install this plugin, you'll be able to open up a tag window.
And in here you can create new tags and see all the tags you already have in your game.
And this SCP part should have the tag SCP 294 attached to it.
So this is how we're going to be able to collect all of our SCP objects.
So make sure you create a new tag named SCP 294 if that tag doesn't already exist, and make sure you
add this part to that tag.
The last thing we have here is our drink animation rig, and this houses some animations for our drink
cup.
So we're going to have two animations.
One is going to be for drinking our drink cup, and the other animation is just going to be for holding
out our drink cup.
And because we can't share animations between different players accounts, you're going to have to open
up the animation editor underneath the avatar tab, select this animation rig, and you'll be able to
load the different animations that I've put in here, which is one for consuming and idling.
So you want to go to each one of these animations.
The first one is idle.
You're going to want to make sure that this idle animation is looped, and the animation priority is
set to movement.
It should be automatically set to that already.
And once you've verified that all of that is good, then we can publish it to Roblox and give it a name
and whatnot.
I believe I already have it uploaded.
Yep, here we are.
I'm just going to overwrite my original one, and once you do that, it should give you an ID here and
you can copy that ID and once you've copied that ID, we can go back to our SCP 294 assets.
And then we can go to our drink cup.
And inside the drink cup I have a folder called animations, one for the consume animation and one for
the idle animation.
And you want to go ahead and paste your ID inside of there.
So again you're going to upload these animations on your account and copy the IDs inside of these animation
instances.
So let's also do the same for the consume animation.
We're going to load it.
Make sure this one isn't looping and make sure the animation priority is set to action.
And then again you can publish it to Roblox.
Give it a name.
I've already uploaded it, so I'm just going to write my original one.
Hit submit and you'll get an ID here.
Copy that.
ID close that out and then we can put that.
ID within our consume animation instance.
So we'll just paste that ID in there and we're good to go.
All right.
So that's all the setup completed.
And in the next lecture we're going to get started scripting our SCP.
So see you there.